<template>
	<view class="">
	  <view class="padding-bottom">
		<view class="cu-form-group solid-top">
			<view class="title text-gray">用车城市</view>
			<view class="text-right">{{detail.carcityName}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">联系人</view>
			<view class="text-right">{{detail.orderName}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">手机号码</view>
			<view class="text-right">{{detail.orderPhone}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">车型车号</view>
			<view class="text-right">{{detail.carInfo}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">司机姓名</view>
			<view class="text-right">{{detail.createName}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">司机电话</view>
			<view class="text-right">{{detail.createPhone}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">类型</view>
			<view class="text-right">
				{{detail.goBackType==1?'往返':'单程'}}
			</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">用车开始时间</view>
			<view class="text-right">{{detail.beginTime}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">用车结束时间</view>
			<view class="text-right">{{detail.endTime}}</view>
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">价格</view>
			<view class="text-right">{{detail.price}}</view>
		</view>
		<view v-if="detail.dispatchInfo" class="bg-white solid-top padding">
			<view class="title text-gray padding-bottom">排车信息</view>
			<textarea :value="detail.dispatchInfo" disabled class="solid padding-sm" style="margin: 0 auto;height: 80px;" />
		</view>
		<view class="cu-form-group">
			<view class="title text-gray">行程信息</view>
		</view>
		<view class="bg-white padding padding-top-xs">
			<textarea :value="detail.travelInfo" disabled class="solid-blue bg-gray padding-sm" style="margin: 0 auto;height: 120px;" />
		</view>
		<view class="cu-form-group solid-top">
			<view class="title text-gray">报价费用说明</view>
		</view>
		<view class="bg-white padding padding-top-xs">
			<textarea :value="detail.remark" disabled class="solid-blue bg-gray padding-sm" style="margin: 0 auto;height: 100px;" />
		</view>
	  </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail: {}
			}
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
			    title: '订单详情'
			});
			this.getDetail(options.id)
		},
		methods: {
			getDetail: function(orderId){
				let self = this;
				uni.showToast({
					title: '请稍候...',
					icon: 'none'
				})
				
				this.baseRequest('app/bus/custorder/info/' + orderId, 'GET', {}, (res)=>{
					uni.hideToast();
					self.detail = res;
				}, function(){
					uni.showToast({
						title: '获取详情失败',
						icon: 'none'
					})
					setTimeout(()=>{
						uni.navigateBack({
							delta: 1
						})
					}, 1000)
				});
			},
		}
	}
</script>